home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / p96pcq.lha / Picasso96PCQ / Include / p96 / Picasso96.i
Encoding:
Text File  |  1997-07-18  |  13.9 KB  |  333 lines

  1.  
  2. {
  3.     Picasso96 - Include     by Andreas "Wurzelsepp" <:-) Neumann
  4.  
  5.  
  6.     für Picasso96API-Library von Alexander Kneer & Tobias Abt ab Version 1.18
  7.  
  8.     basierend auf den Original-Includes von A. Kneer & T. Abt
  9.  
  10.     letzte Bearbeitung  :   31.06.1997
  11.  
  12.     Linkeraufruf    :   blink MyProgram.o lib PCQ.Lib,P96.lib to MyProgram
  13.  
  14.     dieses Includefile darf frei kopiert werden, solange alle Hinweise
  15.     enthalten bleiben
  16.                                                                               }
  17.  
  18. {$I "Include:exec/nodes.i" }
  19.  
  20. {$I "Include:utility/tagitem.i" }
  21.  
  22. {$I "Include:intuition/intuition.i" }
  23.  
  24.  
  25. Var
  26.     P96Base :   Address;
  27.  
  28. { ************************************************************************ }
  29. { This is the name of the library }
  30.  
  31. Const
  32.     P96NAME : String  = "Picasso96API.library";
  33.  
  34. { ************************************************************************ }
  35. { Types for RGBFormat used }
  36.  
  37. Type
  38.     RGBFTYPE = (
  39.         RGBFB_NONE,                             { no valid RGB format (should not happen) }
  40.         RGBFB_CLUT,                             { palette mode, set colors when opening screen using
  41.                                                   tags or use SetRGB32/LoadRGB32(...) }
  42.         RGBFB_R8G8B8,                           { TrueColor RGB (8 bit each) }
  43.         RGBFB_B8G8R8,                           { TrueColor BGR (8 bit each) }
  44.         RGBFB_R5G6B5PC,                         { HiColor16 (5 bit R, 6 bit G, 5 bit B),
  45.                                                   format: gggbbbbbrrrrrggg }
  46.         RGBFB_R5G5B5PC,                         { HiColor15 (5 bit each), format: gggbbbbb0rrrrrgg }
  47.         RGBFB_A8R8G8B8,                         { 4 Byte TrueColor ARGB (A unused alpha channel) }
  48.         RGBFB_A8B8G8R8,                         { 4 Byte TrueColor ABGR (A unused alpha channel) }
  49.         RGBFB_R8G8B8A8,                         { 4 Byte TrueColor RGBA (A unused alpha channel) }
  50.         RGBFB_B8G8R8A8,                         { 4 Byte TrueColor BGRA (A unused alpha channel) }
  51.         RGBFB_R5G6B5,                           { HiColor16 (5 bit R, 6 bit G, 5 bit B),
  52.                                                   format: rrrrrggggggbbbbb }
  53.         RGBFB_R5G5B5,                           { HiColor15 (5 bit each), format: 0rrrrrgggggbbbbb }
  54.         RGBFB_B5G6R5PC,                         { HiColor16 (5 bit R, 6 bit G, 5 bit B),
  55.                                                   format: gggrrrrrbbbbbggg }
  56.         RGBFB_B5G5R5PC,                         { HiColor15 (5 bit each), format: gggrrrrr0bbbbbbgg }
  57.  
  58.         { By now, the following formats are for use with a hardware window only
  59.                 (bitmap operations may be implemented incompletely) }
  60.  
  61.         RGBFB_Y4U2V2,                           { 2 Byte TrueColor YUV (CCIR recommendation CCIR601).
  62.                                                   Each two-pixel unit is stored as one longword
  63.                                                   containing luminance (Y) for each of the two pixels,
  64.                                                   and chrominance (U,V) for alternate pixels.
  65.                                                   The missing chrominance values are generated by
  66.                                                   interpolation. (Y1-U0-Y0-V0) }
  67.         RGBFB_Y4U1V1,                           { 1 Byte TrueColor ACCUPAK. Four adjacent pixels form
  68.                                                   a packet of 5 bits Y (luminance) each pixel and 6 bits
  69.                                                   U and V (chrominance) shared by the four pixels }
  70.  
  71.         RGBFB_MaxFormats
  72.                 );
  73.  
  74. Const
  75.  
  76.     RGBFF_NONE              =               %00000000000000000000000000000001;
  77.     RGBFF_CLUT              =               %00000000000000000000000000000010;
  78.     RGBFF_R8G8B8            =               %00000000000000000000000000000100;
  79.     RGBFF_B8G8R8            =               %00000000000000000000000000001000;
  80.     RGBFF_R5G6B5PC          =               %00000000000000000000000000010000;
  81.     RGBFF_R5G5B5PC          =               %00000000000000000000000000100000;
  82.     RGBFF_A8R8G8B8          =               %00000000000000000000000001000000;
  83.     RGBFF_A8B8G8R8          =               %00000000000000000000000010000000;
  84.     RGBFF_R8G8B8A8          =               %00000000000000000000000100000000;
  85.     RGBFF_B8G8R8A8          =               %00000000000000000000001000000000;
  86.     RGBFF_R5G6B5            =               %00000000000000000000010000000000;
  87.     RGBFF_R5G5B5            =               %00000000000000000000100000000000;
  88.     RGBFF_B5G6R5PC          =               %00000000000000000001000000000000;
  89.     RGBFF_B5G5R5PC          =               %00000000000000000010000000000000;
  90.     RGBFF_Y4U2V2            =               %00000000000000000100000000000000;
  91.     RGBFF_Y4U1V1            =               %00000000000000001000000000000000;
  92.  
  93.  
  94. { ************************************************************************ }
  95. { Attributes for p96GetBitMapAttr }
  96.  
  97. Const
  98.         P96BMA_WIDTH            =           0;
  99.         P96BMA_HEIGHT           =           1;
  100.         P96BMA_DEPTH            =           2;
  101.         P96BMA_MEMORY           =           3;
  102.         P96BMA_BYTESPERROW      =           4;
  103.         P96BMA_BYTESPERPIXEL    =           5;
  104.         P96BMA_BITSPERPIXEL     =           6;
  105.         P96BMA_RGBFORMAT        =           7;
  106.         P96BMA_ISP96            =           8;
  107.  
  108.  
  109. { ************************************************************************ }
  110. { Attributes for p96GetModeIDAttr }
  111.  
  112. Const
  113.  
  114.         P96IDA_WIDTH            =           0;
  115.         P96IDA_HEIGHT           =           1;
  116.         P96IDA_DEPTH            =           2;
  117.         P96IDA_BYTESPERPIXEL    =           3;
  118.         P96IDA_BITSPERPIXEL     =           4;
  119.         P96IDA_RGBFORMAT        =           5;
  120.         P96IDA_ISP96            =           6;
  121.         P96IDA_BOARDNUMBER      =           7;
  122.         P96IDA_STDBYTESPERROW   =           8;
  123.  
  124.  
  125.  
  126. { ************************************************************************ }
  127. { Tags for p96BestModeIDTagList }
  128.  
  129. Const
  130.     P96BIDTAG_Dummy             =       TAG_USER + 96;
  131.  
  132.     P96BIDTAG_FormatsAllowed    =       P96BIDTAG_Dummy + $0001;
  133.     P96BIDTAG_FormatsForbidden  =       P96BIDTAG_Dummy + $0002;
  134.     P96BIDTAG_NominalWidth      =       P96BIDTAG_Dummy + $0003;
  135.     P96BIDTAG_NominalHeight     =       P96BIDTAG_Dummy + $0004;
  136.     P96BIDTAG_Depth             =       P96BIDTAG_Dummy + $0005;
  137.  
  138. { ************************************************************************ }
  139. { Tags for p96RequestModeIDTagList }
  140.  
  141. Const
  142.     P96MA_Dummy                 =       TAG_USER + $10000 + 96;
  143.  
  144.     P96MA_MinWidth              =       P96MA_Dummy + $0001;
  145.     P96MA_MinHeight             =       P96MA_Dummy + $0002;
  146.     P96MA_MinDepth              =       P96MA_Dummy + $0003;
  147.     P96MA_MaxWidth              =       P96MA_Dummy + $0004;
  148.     P96MA_MaxHeight             =       P96MA_Dummy + $0005;
  149.     P96MA_MaxDepth              =       P96MA_Dummy + $0006;
  150.     P96MA_DisplayID             =       P96MA_Dummy + $0007;
  151.     P96MA_FormatsAllowed        =       P96MA_Dummy + $0008;
  152.     P96MA_FormatsForbidden      =       P96MA_Dummy + $0009;
  153.     P96MA_WindowTitle           =       P96MA_Dummy + $000a;
  154.     P96MA_OKText                =       P96MA_Dummy + $000b;
  155.     P96MA_CancelText            =       P96MA_Dummy + $000c;
  156.     P96MA_Window                =       P96MA_Dummy + $000d;
  157.     P96MA_PubScreenName         =       P96MA_Dummy + $000e;
  158.     P96MA_Screen                =       P96MA_Dummy + $000f;
  159.  
  160. { *********************************************************************** }
  161. { Tags for p96OpenScreenTagList }
  162.  
  163. Const
  164.     P96SA_Dummy                 =       TAG_USER + $20000 + 96;
  165.     P96SA_Left                  =       P96SA_Dummy + $0001;
  166.     P96SA_Top                   =       P96SA_Dummy + $0002;
  167.     P96SA_Width                 =       P96SA_Dummy + $0003;
  168.     P96SA_Height                =       P96SA_Dummy + $0004;
  169.     P96SA_Depth                 =       P96SA_Dummy + $0005;
  170.     P96SA_DetailPen             =       P96SA_Dummy + $0006;
  171.     P96SA_BlockPen              =       P96SA_Dummy + $0007;
  172.     P96SA_Title                 =       P96SA_Dummy + $0008;
  173.     P96SA_Colors                =       P96SA_Dummy + $0009;
  174.     P96SA_ErrorCode             =       P96SA_Dummy + $000a;
  175.     P96SA_Font                  =       P96SA_Dummy + $000b;
  176.     P96SA_SysFont               =       P96SA_Dummy + $000c;
  177.     P96SA_Type                  =       P96SA_Dummy + $000d;
  178.     P96SA_BitMap                =       P96SA_Dummy + $000e;
  179.     P96SA_PubName               =       P96SA_Dummy + $000f;
  180.     P96SA_PubSig                =       P96SA_Dummy + $0010;
  181.     P96SA_PubTask               =       P96SA_Dummy + $0011;
  182.     P96SA_DisplayID             =       P96SA_Dummy + $0012;
  183.     P96SA_DClip                 =       P96SA_Dummy + $0013;
  184.     P96SA_ShowTitle             =       P96SA_Dummy + $0014;
  185.     P96SA_Behind                =       P96SA_Dummy + $0015;
  186.     P96SA_Quiet                 =       P96SA_Dummy + $0016;
  187.     P96SA_AutoScroll            =       P96SA_Dummy + $0017;
  188.     P96SA_Pens                  =       P96SA_Dummy + $0018;
  189.     P96SA_SharePens             =       P96SA_Dummy + $0019;
  190.     P96SA_BackFill              =       P96SA_Dummy + $001a;
  191.     P96SA_Colors32              =       P96SA_Dummy + $001b;
  192.     P96SA_VideoControl          =       P96SA_Dummy + $001c;
  193.     P96SA_RGBFormat             =       P96SA_Dummy + $001d;
  194.     P96SA_NoSprite              =       P96SA_Dummy + $001e;
  195.     P96SA_NoMemory              =       P96SA_Dummy + $001f;
  196.     P96SA_RenderFunc            =       P96SA_Dummy + $0020;
  197.     P96SA_SaveFunc              =       P96SA_Dummy + $0021;
  198.     P96SA_UserData              =       P96SA_Dummy + $0022;
  199.     P96SA_Alignment             =       P96SA_Dummy + $0023;
  200.     P96SA_FixedScreen           =       P96SA_Dummy + $0024;
  201.     P96SA_Exclusive             =       P96SA_Dummy + $0025;
  202.  
  203. { ************************************************************************ }
  204.  
  205. Const
  206.     MODENAMELENGTH  =   48;
  207.  
  208. Type
  209.     P96Mode =   Record
  210.                     Node        :   Node;
  211.                     Description :   Array [0..MODENAMELENGTH-1] Of Char;
  212.                     Width       :   Short;
  213.                     Height      :   Short;
  214.                     Depth       :   Short;
  215.                     DisplayID   :   Integer;
  216.                 End;
  217.  
  218.  
  219. { ************************************************************************ }
  220. { Structure to describe graphics data }
  221.  
  222. Type
  223.     RenderInfo =    Record
  224.                         Memory          :   Address;
  225.                         BytesPerRow     :   Short;
  226.                         pad             :   Short;
  227.                         RGBFormat       :   RGBFTYPE;
  228.                     End;
  229.  
  230.  
  231. { ************************************************************************ }
  232. { Structure for p96WriteTrueColorData() and p96ReadTrueColorData() }
  233.  
  234. Type
  235.     TrueColorInfo =     Record
  236.                             PixelDistance,
  237.                             BytesPerRow     :   Integer;
  238.                             RedData,
  239.                             GreenData,
  240.                             BlueData        :   ^Address;
  241.                         End;
  242.  
  243.  
  244. { ************************************************************************ }
  245. { Tags for PIPs }
  246.  
  247. Const
  248.  
  249.     P96PIP_Dummy                =       TAG_USER + $30000 + 96;
  250.     P96PIP_SourceFormat         =       P96PIP_Dummy+1;         { RGBFTYPE (I) }
  251.     P96PIP_SourceBitMap         =       P96PIP_Dummy+2;         { struct BitMap * (G) }
  252.     P96PIP_SourceRPort          =       P96PIP_Dummy+3;         { struct RastPort * (G) }
  253.     P96PIP_SourceWidth          =       P96PIP_Dummy+4;         { ULONG (I) }
  254.     P96PIP_SourceHeight         =       P96PIP_Dummy+5;         { ULONG (I) }
  255.  
  256.  
  257. Function p96OpenScreenTagList (Tags : ^TagItem) : ScreenPtr;
  258.     External;
  259.  
  260. Procedure p96CloseScreen (pScreen : ^Screen);
  261.     External;
  262.  
  263. Function p96AllocModeListTagList (Tags: ^TagItem) : ListPtr;
  264.     External;
  265.  
  266. Procedure p96FreeModeList (ModeList: ^List);
  267.     External;
  268.  
  269. Function p96GetModeIDAttr (DisplayID, attribute_number : Integer) : Integer;
  270.     External;
  271.  
  272. Function p96AllocBitMap (SizeX, SizeY, Depth, Flags : Integer; friend_bitmap: BitMapPtr; RGBFormat: RGBFTYPE) : BitMapPtr;
  273.     External;
  274.  
  275. Procedure p96FreeBitMap (bm : BitMapPtr);
  276.     External;
  277.  
  278. Function p96GetBitMapAttr (bm : BitMapPtr; attribute_number : Integer) : Integer;
  279.     External;
  280.  
  281. Function p96LockBitMap (bm : BitMapPtr; buf : ^Byte; size : Integer) : Integer;
  282.     External;
  283.  
  284. Procedure p96UnlockBitMap (bm : BitMapPtr; Lock: Integer);
  285.     External;
  286.  
  287. Procedure p96WritePixelArray (ri : ^RenderInfo; SrcX, SrcY : Short; rp : RastPortPtr; DestX, DestY, SizeX, SizeY : Short);
  288.     External;
  289.  
  290. Procedure p96ReadPixelArray (ri : ^RenderInfo; DestX, DestY : Short; rp : RastPortPtr; SrcX, SrcY, SizeX, SizeY : Short);
  291.     External;
  292.  
  293. Procedure p96WritePixel (rp : RastPortPtr; x, y : Short; color : Integer);
  294.     External;
  295.  
  296. Function p96ReadPixel (rp : RastPortPtr; x, y : Short) : Integer;
  297.     External;
  298.  
  299. Procedure p96RectFill (rp : RastPortPtr; MinX, MinY, MaxX, MaxY : Short; ARGB : Integer);
  300.     External;
  301.  
  302. Procedure p96WriteTrueColorData (tci : ^TrueColorInfo; SrcX, SrcY : Short; rp : RastPortPtr; DestX, DestY, SizeX, SizeY : Short);
  303.     External;
  304.  
  305. Procedure p96ReadTrueColorData (tci : ^TrueColorInfo; DestX, DestY : Short; rp : RastPortPtr; SrcX, SrcY, SizeX, SizeY : Short);
  306.     External;
  307.  
  308. Function p96PIP_OpenTagList (Tags : ^TagItem) : WindowPtr;
  309.     External;
  310.  
  311. Procedure p96PIP_Close (pWindow : WindowPtr);
  312.     External;
  313.  
  314. Function p96PIP_SetTagList (pWindow : WindowPtr; Tags : ^TagItem) : Integer;
  315.     External;
  316.  
  317. Procedure p96PIP_GetTagList (pWindow : WindowPtr; Tags : ^TagItem);
  318.     External;
  319.  
  320. Function p96PIP_GetIMsg (pPort : MsgPortPtr) : IntuiMessagePtr;
  321.     External;
  322.  
  323. Procedure p96PIP_ReplyIMsg (pIntuiMessage : IntuiMessagePtr);
  324.     External;
  325.  
  326. Function p96BestModeIDTagList (Tags : ^TagItem) : Integer;
  327.     External;
  328.  
  329. Function p96RequestModeIDTagList (Tags : ^TagItem) : Integer;
  330.     External;
  331.  
  332.  
  333.